package utils;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

/**
 * Created by asus on 2017/5/14.
 */
public class ReflectionUtils {
    public static <T> Class<T> getSuperGenericType(Class clazz){

        Type genType = clazz.getGenericSuperclass();
        Type[] params=null;
        if (genType instanceof ParameterizedType) {
            params = ((ParameterizedType) genType).getActualTypeArguments();
            System.out.println( (Class)params[0]);
            return (Class)params[0];
        }
        System.out.println("wrong");
        return null;
    }
}
